﻿/// ****************************************************************************
/// Author:	        Robin Zhu
/// Create Date:	2012-4-28
/// Purpose: 		权限审核服务接口
/// ****************************************************************************
/// Modify By		Date			Remark
/// Robin           2014-6-9        增加按ticket获取可用Permission的接口
/// Robin           2015-2-26       增加GetRolesByUrl接口
/// Robin           2015-3-2        增加GetAppEntries接口
/// ****************************************************************************
/// 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

namespace RB.Web.Security
{
    [ServiceContract]
    public interface IAuthorizeService
    {
        [OperationContract]
        bool IsAllowed(string appCode, Guid userId, string path, string httpMethod);

        [OperationContract]
        bool Authorize(string appCode, string ticket, string pathAndQuery, string httpMethod);

        [OperationContract]
        AppMenu[] GetAppMenus(string appCode, Guid userId);

        [OperationContract]
        string[] GetPermissionCodesByTicket(string appCode, string ticket);

        [OperationContract]
        Permission[] GetAllPermissions(string appCode);

        [OperationContract(IsOneWay = true)]
        void LogAction(string appCode, string ticket, string permCode, string pathAndQuery, bool authorized, string ipAddress, string httpForwarded);

        [OperationContract]
        string[] GetRolesByUrl(string appCode, string url);

        [OperationContract]
        AppEntry[] GetAppEntries(string ticket);
    }
}
